﻿<Page
    x:Class="TestApp.MainPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:metroEventToCommand="using:MetroEventToCommand"
    mc:Ignorable="d">

    <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
        <Grid.ColumnDefinitions>
            <ColumnDefinition></ColumnDefinition>
            <ColumnDefinition></ColumnDefinition>
            <ColumnDefinition></ColumnDefinition>
            <ColumnDefinition></ColumnDefinition>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
            <RowDefinition Height="Auto"></RowDefinition>
        </Grid.RowDefinitions>
        <TextBlock Grid.ColumnSpan="4" HorizontalAlignment="Center" Margin="0,20" Style="{StaticResource PageHeaderTextStyle}">Click to test</TextBlock>
        <!-- Event with no parameters -->
        <Button Grid.Column="0" Grid.Row="1" Content="No parameter" HorizontalAlignment="Center">
            <metroEventToCommand:EventToCommandManager.Collection>
                <metroEventToCommand:EventToCommand Command="{Binding Test1Command}" Event="Click"></metroEventToCommand:EventToCommand>
            </metroEventToCommand:EventToCommandManager.Collection>
        </Button>
        <!-- Event with with parameters -->
        <Button Grid.Column="1" Grid.Row="1" Content="Parameter" HorizontalAlignment="Center">
            <metroEventToCommand:EventToCommandManager.Collection>
                <metroEventToCommand:EventToCommand Command="{Binding Test2Command}" HandleEvent="True" CommandParameter="{Binding SimpleParam}" Event="Click"></metroEventToCommand:EventToCommand>
            </metroEventToCommand:EventToCommandManager.Collection>
        </Button>
        <!-- Event with with event parameters (I understand myself) -->
        <Button Grid.Column="2" Grid.Row="1" Content="Event parameter" HorizontalAlignment="Center">
            <metroEventToCommand:EventToCommandManager.Collection>
                <metroEventToCommand:EventToCommand Command="{Binding Test3Command}" CommandParameter="{Binding SimpleParam}" Event="Click" />
            </metroEventToCommand:EventToCommandManager.Collection>
        </Button>

        <!-- Event with with event parameters (I understand myself) and non binding CommandParameter -->
        <Button Grid.Column="3" Grid.Row="1" Content="Event parameter + non binding param" HorizontalAlignment="Center">
            <metroEventToCommand:EventToCommandManager.Collection>
                <metroEventToCommand:EventToCommand Command="{Binding Test4Command}" CommandParameter="111" Event="Click" />
            </metroEventToCommand:EventToCommandManager.Collection>
        </Button>
        
        <!-- result label -->
        <TextBlock Grid.Column="0" Grid.ColumnSpan="4" Grid.Row="2" HorizontalAlignment="Center" Margin="0,10" Style="{StaticResource PageHeaderTextStyle}">Result</TextBlock>

        <!-- Results Columns -->
        <StackPanel Grid.Column="0" Grid.Row="3" Orientation="Vertical" HorizontalAlignment="Center">
            <TextBlock x:Name="Test1PassedTB" FontWeight="Bold" Foreground="Green" Visibility="Collapsed" Style="{StaticResource PageSubheaderTextStyle}">Passed</TextBlock>
            <TextBlock x:Name="Test1FailedTB" FontWeight="Bold" Foreground="Red" Visibility="Collapsed" Style="{StaticResource PageSubheaderTextStyle}">Failed</TextBlock>
        </StackPanel>

        <StackPanel Grid.Column="1" Grid.Row="3" Orientation="Vertical" HorizontalAlignment="Center">
            <TextBlock x:Name="Test2PassedTB" FontWeight="Bold" Foreground="Green" Visibility="Collapsed" Style="{StaticResource PageSubheaderTextStyle}">Passed</TextBlock>
            <TextBlock x:Name="Test2FailedTB" FontWeight="Bold" Foreground="Red" Visibility="Collapsed" Style="{StaticResource PageSubheaderTextStyle}">Failed</TextBlock>
        </StackPanel>

        <StackPanel Grid.Column="2" Grid.Row="3" Orientation="Vertical" HorizontalAlignment="Center">
            <TextBlock x:Name="Test3PassedTB" FontWeight="Bold" Foreground="Green" Visibility="Collapsed" Style="{StaticResource PageSubheaderTextStyle}">Passed</TextBlock>
            <TextBlock x:Name="Test3FailedTB" FontWeight="Bold" Foreground="Red" Visibility="Collapsed" Style="{StaticResource PageSubheaderTextStyle}">Failed</TextBlock>
        </StackPanel>


        <StackPanel Grid.Column="3" Grid.Row="3" Orientation="Vertical" HorizontalAlignment="Center">
            <TextBlock x:Name="Test4PassedTB" FontWeight="Bold" Foreground="Green" Visibility="Collapsed" Style="{StaticResource PageSubheaderTextStyle}">Passed</TextBlock>
            <TextBlock x:Name="Test4FailedTB" FontWeight="Bold" Foreground="Red" Visibility="Collapsed" Style="{StaticResource PageSubheaderTextStyle}">Failed</TextBlock>
        </StackPanel>
    </Grid>
</Page>
